<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>   
<%@ page import="java.util.HashMap" %>   
<%@ page import="com.cjx.util.GetData" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页</title>
<style>
#tophead{margin:0 auto;border:0px solid #000;width:500px;height:50px;line-height:40px;margin-top: 25px} 
#tophead2{margin:0 auto;border:0px solid #000;width:500px;height:50px;line-height:40px;margin-top: 25px} 
table{
	border-collapse: collapse;
	width:500px;
	text-align:center
}
th{
border: 1px solid #666666;
}
td{
border: 1px solid #666666;
}
.add{
position:relative;
left:0px;
top:10px;
width:80px;
background-color:#00BFFF;
}
</style>
<script src="../WebTest/js/jquery-1.8.3.min.js"></script>
<SCRIPT LANGUAGE="JavaScript">   
   window.onload = function(){
    $("tr").bind("click",function(){
    	if("未结算"==$(this).find("#status").val()){
    		location.href='../WebTest/addservlet?AC=groupList&roundid='+$(this).find("#roundid").val();
    	}else if("已结算"==$(this).find("#status").val()){
    		location.href='../WebTest/addservlet?AC=totalinfo&roundid='+$(this).find("#roundid").val();
    	}
    });
   }  
</SCRIPT>  
</head>
<body>
<div id="tophead">
<h1>斗地主记账系统</h1>
</div>
<div id="tophead2">
<input class="add" type="button" value="新增" onclick="javascript:location.href='../WebTest/addservlet?AC=add'">
</div>
<table  id=table1 align="center" valign="center">
<thead>
<tr  style='background-color:#00BFFF'>
<td>序号</td>
<td>时间</td>
<td>玩家A</td>
<td>玩家B</td>
<td>玩家C</td>
<td>状态</td>
</tr>
</thead>
<tbody>
<%
GetData gd = new GetData();
List<HashMap> list = gd.getRoundList();
for(int i=0;i<list.size();i++){
%>
<tr>
<input id="roundid" type="hidden" value=<%=list.get(i).get("ROUNDID")%>>
<input id="status" type="hidden" value=<%=list.get(i).get("STATUS")%>>
<td><%=i+1%></td>
<td><%=list.get(i).get("STARTTIME")%></td>
<td id="ascore"><%=list.get(i).get("PERSONA")%>&nbsp;&nbsp;[<%=list.get(i).get("ASCORE")%>]</td>
<td id="bscore"><%=list.get(i).get("PERSONB")%>&nbsp;&nbsp;[<%=list.get(i).get("BSCORE")%>]</td>
<td id="cscore"><%=list.get(i).get("PERSONC")%>&nbsp;&nbsp;[<%=list.get(i).get("CSCORE")%>]</td>
<td><%=list.get(i).get("STATUS")%></td>
</tr>
<%
}
%>
<tbody>  
</table>	
</body>

</html>